package cn.edu.njpi.排序;

/**
 * @author 朱宗辉
 * @version V1.0
 * @Package cn.edu.njpi.排序
 * @date 2021/7/30 20:04
 */
public class 冒泡 {
    public static void main(String[] args) {
        int[] i = {1, 3, 41, 32, 54, 6, 45};
        for (int x = 0; x < i.length; x++) {
            for (int y = 0; y < i.length; y++) {
                if (i[y] < i[x]) {
                    int a = i[y];
                    i[y] = i[x];
                    i[x] = a;
                }
            }
        }

        for (int i1 : i) {
            System.out.print(i1 + "\t");
        }
    }
}
